import 'package:xinxuan/vo/common_vo/common_pagination_vo.dart';

class UserInvitationsVo {

  List<UserInvitationsItem>? data;
  UserInvitationsMeta? meta;

  UserInvitationsVo({this.data, this.meta});

  UserInvitationsVo.fromJson(Map<String, dynamic> json) {
    if (json['data'] != null) {
      data = <UserInvitationsItem>[];
      json['data'].forEach((v) {
        data!.add(new UserInvitationsItem.fromJson(v));
      });
    }
    meta = json['meta'] != null ? new UserInvitationsMeta.fromJson(json['meta']) : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.data != null) {
      data['data'] = this.data!.map((v) => v.toJson()).toList();
    }
    if (this.meta != null) {
      data['meta'] = this.meta!.toJson();
    }
    return data;
  }
}

class UserInvitationsItem {
  String? username;
  String? createdAt;
  int? isPurchased;

  UserInvitationsItem({this.username, this.createdAt, this.isPurchased});

  UserInvitationsItem.fromJson(Map<String, dynamic> json) {
    username = json['username'];
    createdAt = json['created_at'];
    isPurchased = json['is_purchased'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['username'] = this.username;
    data['created_at'] = this.createdAt;
    data['is_purchased'] = this.isPurchased;
    return data;
  }
}

class UserInvitationsMeta {
  CommonPagination? pagination;

  UserInvitationsMeta({this.pagination});

  UserInvitationsMeta.fromJson(Map<String, dynamic> json) {
    pagination = json['pagination'] != null
        ? new CommonPagination.fromJson(json['pagination'])
        : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.pagination != null) {
      data['pagination'] = this.pagination!.toJson();
    }
    return data;
  }
}
